import request from "@/utils/request";
import { AxiosPromise } from "axios";

/**
* 工作队列表数据
*
* @param queryParams
*/
export function getSysWorkingQueuePage(queryParams) {
    return request({
        url: '/api/v1/workingQueue/page',
        method: 'get',
        params: queryParams
    });
}


/**
* 获取工作队列表表单数据
*
* @param queryParams
*/
export function getSysWorkingQueueForm(id: number){
    return request({
        url: '/api/v1/workingQueue/' + id + '/form',
        method: 'get'
    });
}

/**
* 保存工作队列表
*
* @param data
*/
export function saveSysWorkingQueue(data) {
    return request({
        url: "/api/v1/workingQueue",
        method: "post",
        data: data,
    });
}

/**
* 删除工作队列表
*
* @param ids
*/
export function deleteSysWorkingQueue(ids: string) {
    return request({
    url: '/api/v1/workingQueue/' + ids,
    method: 'delete'
    });
}

/**
* 导入工作队列表
*
* @param file
*/
export function importSysWorkingQueue(file: any) {
    const formData = new FormData();
    formData.append('file', file);
    return request({
        url: '/api/v1/workingQueue/sysWorkingQueueImport',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

/**
* 导出工作队列表
*
* @param ids
* @returns
*/
export function exportSysWorkingQueue(ids: any) {
    return request({
        url: '/api/v1/workingQueue/_export?ids='+ids,
        method: 'get',
        responseType: 'arraybuffer'
    });
}